home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWViews / FWViews.k < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.3 KB  |  140 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWViews.k
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. //
  10. //    Constants shared between the framework code and view resources
  11. //
  12.  
  13. #ifndef FWVIEWS_K
  14. #define FWVIEWS_K
  15.  
  16. #ifndef FWBLDDEF_H
  17. #include "FWBldDef.h"
  18. #endif
  19.  
  20. //----------------------------------------------------------------------------------------
  21. // Resource Types
  22. //----------------------------------------------------------------------------------------
  23.  
  24. #ifdef FW_BUILD_MAC
  25. #define FW_kViewLayoutResourceType        'FWvl'
  26. #define FW_kFontResourceType            'FWft'
  27. #endif
  28.  
  29. //----------------------------------------------------------------------------------------
  30. // View Bindings
  31. //----------------------------------------------------------------------------------------
  32. // These constants are used to define the layout management of subviews inside a superview
  33. // which is being resized.
  34. //     - Each side of a FW_CView object can remain at a fixed distance to its parent view 
  35. //      with the left/right/top/bottom binding values set.
  36. //     - You can also combine that with a fixed width or height (not all combinations are valid)
  37. //
  38. // By default a FW_CView object is created with a FW_kFixedBounds binding, which means that
  39. // it doesn't move when its parent view is resized.
  40. // Some subclasses of FW_CView override this with other default values:
  41. //     - FW_CSuperView's default binding = FW_kFitToEnclosure.
  42. //     - FW_CScrollBar's default binding =  FW_kVScrollBarBinding or FW_kHScrollBarBinding
  43. //     - FW_CGrowBox's default binding = FW_kGrowBoxBinding
  44. //
  45. // When declaring views in a .fr resource file you must enter the default value or any
  46. // other ones that make sense (leaving 0 means no binding at all and it won't yield good
  47. // results in general).  Of course the binding value will be ignored if you provide your
  48. // own layout management code in MyView::AdjustToNewLayout().
  49.  
  50. #define FW_kNoBinding         0x00000000
  51. #define FW_kLeftBinding     0x00000001
  52. #define FW_kRightBinding     0x00000002
  53. #define FW_kTopBinding         0x00000004
  54. #define FW_kBottomBinding     0x00000008
  55. #define FW_kFixedWidth         0x00000010
  56. #define FW_kFixedHeight     0x00000020
  57.  
  58. #define FW_kFixedLocation    (FW_kLeftBinding + FW_kTopBinding)
  59. #define FW_kFixedSize        (FW_kFixedWidth + FW_kFixedHeight)
  60. #define FW_kFixedBounds        (FW_kFixedLocation + FW_kFixedSize)
  61. #define FW_kFitToEnclosure    (FW_kFixedLocation + FW_kRightBinding + FW_kBottomBinding)
  62.  
  63. #define FW_kVScrollBarBinding     (FW_kTopBinding+FW_kRightBinding+FW_kFixedWidth+FW_kBottomBinding)
  64. #define FW_kHScrollBarBinding    (FW_kLeftBinding+FW_kBottomBinding+FW_kFixedHeight+FW_kRightBinding)
  65.  
  66. #define FW_kGrowBoxBinding        (FW_kBottomBinding+FW_kRightBinding+FW_kFixedSize)
  67.  
  68. //----------------------------------------------------------------------------------------
  69. // View scrolling direction
  70. //----------------------------------------------------------------------------------------
  71.  
  72. enum FW_EScrollingDirection 
  73. {
  74.     FW_kNoScrolling    = 0x0000,
  75.     FW_kXScrolling    = 0x0001,
  76.     FW_kYScrolling    = 0x0010,
  77.     FW_kXYScrolling    = 0x0011
  78. };
  79.  
  80. //----------------------------------------------------------------------------------------
  81. // View Updating
  82. //----------------------------------------------------------------------------------------
  83.  
  84. enum FW_ERedrawVerb
  85. {
  86.     FW_kDontRedraw,
  87.     FW_kInvalidate
  88.     // A future version of ODF will add FW_kRedrawNow
  89. };
  90.  
  91. //----------------------------------------------------------------------------------------
  92. // Control receivers
  93. //----------------------------------------------------------------------------------------
  94. // Use the constants below to define which receiver handles the control's message.
  95. // (mainly used for push buttons)
  96. // Warning: if you want the control's view or the frame to be the receiver
  97. //            you need to be sure that its class inherits from FW_MReceiver
  98.  
  99. #define FW_kNoReceiver            0
  100. #define FW_kViewReceiver        1
  101. #define FW_kFrameReceiver        2
  102. // #define FW_kPartReceiver        3 (gsf: not supported yet)
  103.  
  104. // Scroll-bars are a special case, the scroller is always the default receiver
  105. #define FW_kScrollerReceiver    0
  106.  
  107. //----------------------------------------------------------------------------------------
  108. // Button kinds
  109. //----------------------------------------------------------------------------------------
  110.  
  111. #define FW_kPushButton            0
  112. #define FW_kRadioButton            1
  113. #define FW_kCheckButton            2
  114. #define FW_kDefaultPushButton    3
  115.  
  116. #define FW_kMaxButtonKind        FW_kDefaultPushButton
  117.  
  118. //----------------------------------------------------------------------------------------
  119. // Reserved Object IDs for preregistering the root view
  120. //----------------------------------------------------------------------------------------
  121.  
  122. #define FW_kPreregisteredRootViewObject     -301
  123. #define FW_kPreregisteredFrameObject         -303
  124.  
  125. //----------------------------------------------------------------------------------------
  126. // Useful defines
  127. //----------------------------------------------------------------------------------------
  128.  
  129. #define FW_MAXINT16            32767
  130. #define FW_MININT16            -32768
  131.  
  132. //----------------------------------------------------------------------------------------
  133. // Default view id
  134. //----------------------------------------------------------------------------------------
  135.  
  136. #define FW_kNoViewID        0
  137.  
  138.  
  139. #endif
  140.